Add API for custom component theming with M3#27617
Merged
Merged
Conversation
ba52651 to
74718a1
Compare
74718a1 to
6d27dd3
Compare
andrewseguin
approved these changes
Aug 11, 2023
8afc00e to
32eedf7
Compare
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A new API for this is necessary because the existing APIs (e.g.
mat.get-color-from-palette) require the user to have some knowledge of how the theme object is structured. With the M3 theme objects, we made he decision that the theme object structure should be opaque to the user.I will do a followup PR to add support for using the same API to access values from M2 theme objects. This will allow users to move their custom components on to the new API before updating to use an M3 theme.
With the new theming APIs, I'm focusing on trying to catch common errors a user might make and report helpful error messages rather than the
$map: null is not a maperrors that our previous APIs often threw. I've added tests to cover these error cases as well as the expected cases.I'm introducing the APIs as private in this PR, but will do a followup once they have M2 theme support to make them public.